package su.validator.core.pwd;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;


public class PasswordValidator implements ConstraintValidator<PasswordConsistency, Password> {

    @Override
    public boolean isValid(Password password, ConstraintValidatorContext constraintValidatorContext) {
        if (password == null) {
            return false;
        }
        if (password.getInput1() == null) {
            return false;
        }
        if (password.getInput1().equals(password.getInput2())) {
            return false;
        }
        return true;
    }
}
